<template>
  <el-card>
    <el-scrollbar>
      <el-table :data="tableData" style="width: 100%">
        <el-table-column fixed prop="id" label="id" width="150" />
        <el-table-column prop="name" label="Name" width="240" />
        <el-table-column prop="createTime" label="Time" width="260" />
        <el-table-column prop="code" label="code" width="120" />
        <el-table-column prop="sort" label="sort" width="200" />
        <el-table-column prop="status" label="status" width="120" />
        <el-table-column fixed="right" label="Operations" min-width="120">
          <template #default="{ row }">
            <el-button link type="primary" size="small" @click="handleClick(row)">
              修改信息
            </el-button>
            <el-button link type="primary" size="small" @click="deldata(row)">删除数据</el-button>
            <!-- <el-button type="primary" @click="addItemHandler(row)"> 添加 </el-button> -->
          </template>
        </el-table-column>
      </el-table>
    </el-scrollbar>
  </el-card>
</template>

<script setup lang="ts">
defineProps(['tableData'])
const emit = defineEmits(['handleClick', 'deldata'])
const handleClick = (row: any) => {
  emit('handleClick', row)
}
const deldata = (row: any) => {
  emit('deldata', row)
}
</script>

<style></style>
